<template>
  <div class="comments">
    <div class="title">热门评论</div>
    <div class="commentsInner">
      <div class="top">
        <div class="tl">
          <div class="tll">{{ comments.overall }}</div>
          <div class="tlr">
            <div class="tr1">{{ comments.scoreTitle }}</div>
            <div class="tr2">{{ comments.totalCount }}条评论</div>
            <div class="tr3">
              <van-rate v-model="comments.overall" color="#ff9645" size="12" readonly allow-half />
            </div>
          </div>
        </div>
        <div class="tr">
          <template v-for="(item, i) in comments.subScores" :key="i">
            <span>{{ item }}</span>
          </template>
        </div>
      </div>
      <div class="center">
        <template v-for="(item1, i) in comments.commentsTagVo" :key="i">
          <span>{{ item1.text }}</span>
        </template>
      </div>
      <div class="bottom">
        <div class="introduce">
          <img :src="comments.comment.userAvatars" alt="">
          <div class="introduceLeft">
            <p>{{ comments.comment.userName }}</p>
            <p class="p1">{{ comments.comment.checkInDate }}</p>
          </div>
        </div>
        <div class="detail">
          <span>{{ comments.comment.commentDetail }}</span>
        </div>
      </div>
    </div>
    <div class="footer">查看全部设施</div>
  </div>
</template>
<script setup>
const props = defineProps(['comments'])
</script>
<style lang="less" scoped>
.comments {
  padding: 16px 16px 35px;
  background-color: #fff;
  position: relative;

  .title {
    font-weight: 700;
    font-size: 20px;
    color: rgb(51, 51, 51);
    text-align: justify;
    line-height: 24px;
    overflow: hidden;
    padding: 0 0 12px;
    margin-bottom: 8px;
    border-bottom: 2px solid #f7f9fb;
  }

  .commentsInner {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;

    .top {
      display: flex;
      justify-content: space-between;
      height: 46px;

      .tl {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .tll {
          font-size: 48px;
          position: relative;
          margin-right: 15px;

          &::after {
            content: '';
            position: absolute;
            bottom: 5px;
            right: 0;
            left: 0;
            border-bottom: 6px solid #ff9645;
            border-radius: 10px;
          }
        }

        .tlr {
          .tr2 {
            color: #999;
            font-size: 12px;
            margin-top: 4px;
          }
        }
      }

      .tr {
        display: flex;
        flex-wrap: wrap;
        width: 50%;

        span {
          margin-left: 15px;
          font-size: 12px;
          color: #666;
        }
      }
    }

    .center {
      margin-top: 20px;
      display: flex;
      flex-wrap: wrap;

      span {
        padding: 3px 5px;
        margin-right: 8px;
        margin-top: 5px;
        border-radius: 8px;
        font-size: 12px;
        color: rgb(102, 102, 102);
        background: rgb(245, 245, 245);
      }
    }

    .bottom {
      padding: 10px;
      border-radius: 6px;
      background-color: #f7f9fb;
      display: flex;
      flex-direction: column;
      justify-content: space-around;

      .introduce {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 15px;

        .p1 {
          font-size: 12px;
          color: #999;
        }

        .introduceLeft {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
        }
      }

      img {
        height: 32px;
        width: 32px;
        border-radius: 50%;
        margin-right: 10px;
      }
    }

    .detail {
      font-size: 12px;
      line-height: 16px;
      color: #333;
    }
  }

  .footer {
    color: rgb(255, 150, 69);
    position: absolute;
    right: 20px;
    line-height: 44px;
    color: #ff9645;
    font-size: 14px;
    font-weight: 600;

    &::after {
      content: '';
      display: inline-block;
      width: 6px;
      height: 6px;
      border-left: 1px solid rgb(255, 150, 69);
      border-bottom: 1px solid rgb(255, 150, 69);
      transform: rotate(223deg);
      margin-left: 8px;
    }
  }
}
</style>
